package edu.hrbeu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.hrbeu.entity.Role;
import edu.hrbeu.entity.User;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.stereotype.Repository;


/**
 * @author wzq
 * @create 2022-01-06-10:12
 */
@Repository
public interface UserMapper extends BaseMapper<User> {
    @Results(id="rmUser",value={
            @Result(id = true,property = "id",column = "id"),
            @Result(property = "role",javaType = Role.class,column = "role_id",
                    one = @One(select = "edu.hrbeu.mapper.RoleMapper.selectById")
            )
    })
    public User rmUser();
}
